<?php

// Include
include_once('include/header.php');
include_once('plugin/EmpresaDBPlugin.php');


// Breadcrumb
$breadcrumb = AppConfigPlugin::getBreadcrumb(basename($_SERVER['PHP_SELF']));
$smarty->assign('breadcrumb', $breadcrumb);



if (isset($_POST[sendform])) {
	if (isset($_POST[action]) && $_POST[action] == "save") {
		EmpresaDBPlugin::saveLaEmpresa($_POST[elm1]);
		$message = "Se ha guardado correctamente";
		CommonPlugin::setMessage($message);
	}
	header( 'Location: laempresa.php' );
	exit;	
} else {
	$text = EmpresaDBPlugin::getLaEmpresa();
}


// Smarty call
$smarty->assign('text', $text);

$smarty->display('editlaempresa.tpl');

?>